package com.xqboss.apps.service.nft;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xqboss.apps.domain.nft.NftPublisher;
import com.xqboss.apps.mapper.nft.NftPublisherMapper;
import com.xqboss.common.utils.DateUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class NftPublisherService extends ServiceImpl<NftPublisherMapper, NftPublisher> {

    @Resource
    private NftPublisherMapper nftPublisherMapper;

    /**
     * 查询发行方
     *
     * @param id 发行方主键
     * @return 发行方
     */

    public NftPublisher selectNftPublisherById(Long id) {
        return nftPublisherMapper.selectNftPublisherById(id);
    }

    /**
     * 查询发行方列表
     *
     * @param nftPublisher 发行方
     * @return 发行方
     */

    public List<NftPublisher> selectNftPublisherList(NftPublisher nftPublisher) {
        return nftPublisherMapper.selectNftPublisherList(nftPublisher);
    }

    /**
     * 新增发行方
     *
     * @param nftPublisher 发行方
     * @return 结果
     */
    public int insertNftPublisher(NftPublisher nftPublisher) {
        nftPublisher.setCreateTime(DateUtils.getNowDate());
        return nftPublisherMapper.insertNftPublisher(nftPublisher);
    }

    /**
     * 修改发行方
     *
     * @param nftPublisher 发行方
     * @return 结果
     */
    public int updateNftPublisher(NftPublisher nftPublisher) {
        nftPublisher.setUpdateTime(DateUtils.getNowDate());
        return nftPublisherMapper.updateNftPublisher(nftPublisher);
    }

    /**
     * 批量删除发行方
     *
     * @param ids 需要删除的发行方主键
     * @return 结果
     */
    public int deleteNftPublisherByIds(Long[] ids) {
        return nftPublisherMapper.deleteNftPublisherByIds(ids);
    }

    /**
     * 删除发行方信息
     *
     * @param id 发行方主键
     * @return 结果
     */
    public int deleteNftPublisherById(Long id) {
        return nftPublisherMapper.deleteNftPublisherById(id);
    }

}
